package com.changli01._throwable;

public class ExceptionTest {
    public static void main(String[] args) {
//        1.ArrayIndexOutOfBoundsException异常
//        int [] a = new int[10];
//        System.out.println(a[10]);



//        2.NullPointerException异常
//        String name = null;
//        System.out.println(name.toString());



//        3.ClassCastException 异常
//        Object str = new String();
//        Object obj = (Object) str;
//        Date date = (Date)str;



//        4.NumberFormatException异常
//        String name = "123a";
//        int i = Integer.parseInt(name);
//        System.out.println(i);



//        5.InputMismatchException 异常
//        Scanner sc = new Scanner(System.in);
//        int a = sc.nextInt();


//        6.ArithmeticException异常
//        int num = (10/0);
    }

}
